package com.excesys.exsecs.energy.service;

import cn.hutool.core.lang.tree.Tree;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.excesys.exsecs.energy.entity.DevBranchMap;
import com.excesys.exsecs.energy.entity.DimBranch;

import java.util.List;
import java.util.Map;

public interface DimBranchService extends IService<DimBranch> {

	List<Tree<Long>> queryTree(DimBranch dimBranch);

	DimBranch getBranchById(Long id);

	/**
	 * 保存或更新支路与关联表计的关系
	 */
	boolean saveDevBranchMap(DimBranch dimBranch);

	/**
	 * 删除部门及关联表计关系和分区关系
	 */
	boolean removeBranchBatchByIds(List<Long> ids);

	List<DevBranchMap> getMetersById(DimBranch dimBranch);
	//桑基图
	JSONObject powerBranchSanchitou(String id, String startDate, String endDate);
	JSONObject powerBranchBingtu(String startDate, String endDate);

	/*
	 * 能耗报表
	 * */
	List<Map<String, Object>> getBranchReportPage(String ids, String date);
	/*
	 * 能耗对比
	 * */
	JSONObject powerBranchContrast(String ids, String startDate, String endDate);

	/*
	 * 能耗排序
	 * */
	List<Map<String, Object>> branchSort(String ids, String startDate, String endDate, String order);
}